﻿//uses network helper

(function($) {

    $.fn.progressLoad = function(url, callback) {
        this.each(function() {
            var wrapper = $('<div style="position:relative;width:100%;height:100%;"></div>');

            $('<img src="/static/img/spinner.gif" alt="chargement..." />')
                .css("position", "absolute")
                .css("top", ($(this).height() - 32) / 2 + "px")
                .css("left", ($(this).width() - 32) / 2 + "px")
                .appendTo(wrapper);

            $(this).append(wrapper);

            kavadenn.loadContent($(this), url, callback);
        });
        return this;
    };

})(jQuery);
